<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8" />
   
  <meta name="keywords" content="Java Python" />
   
  <meta name="description" content="From Zero to Hero" />
  
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
  <title>
     朱酱酱的学习博客
  </title>
  <meta name="generator" content="hexo-theme-yilia-plus">
  
  <link rel="shortcut icon" href="/favicon.ico" />
  
  
<link rel="stylesheet" href="/css/style.css">

  
<script src="/js/pace.min.js"></script>


  

  

<link rel="alternate" href="/atom.xml" title="朱酱酱的学习博客" type="application/atom+xml">
</head>

</html>

<body>
  <div id="app">
    <main class="content">
      
<section class="cover">
    
      
      <a class="forkMe" href="https://github.com/Zhuuuuuuuu"
        target="_blank"><img width="149" height="149" src="/images/forkme.png"
          class="attachment-full size-full" alt="Fork me on GitHub" data-recalc-dims="1"></a>
    
  <div class="cover-frame">
    <div class="bg-box">
      <img src="/images/cover4.jpg" alt="image frame" />
    </div>
    <div class="cover-inner text-center text-white">
      <h1><a href="/">朱酱酱的学习博客</a></h1>
      <div id="subtitle-box">
        
        <span id="subtitle"></span>
        
      </div>
      <div>
        
      </div>
    </div>
  </div>
  <div class="cover-learn-more">
    <a href="javascript:void(0)" class="anchor"><i class="ri-arrow-down-line"></i></a>
  </div>
</section>



<script src="https://cdn.jsdelivr.net/npm/typed.js@2.0.11/lib/typed.min.js"></script>

<div id="main">
  <section class="outer">
  <article class="articles">
    
    
    
    
    <article id="post-Mysql/Mysql-06-事务" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2019/02/19/Mysql/Mysql-06-%E4%BA%8B%E5%8A%A1/"
    >Mysql-06-事务</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2019/02/19/Mysql/Mysql-06-%E4%BA%8B%E5%8A%A1/" class="article-date">
  <time datetime="2019-02-19T08:02:27.000Z" itemprop="datePublished">2019-02-19</time>
</a>
      
      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h1 id="Mysql-06-事务"><a href="#Mysql-06-事务" class="headerlink" title="Mysql-06-事务"></a>Mysql-06-事务</h1><h2 id="Mysql-事务"><a href="#Mysql-事务" class="headerlink" title="Mysql 事务"></a>Mysql 事务</h2><p><strong>事务：==要么都成功，要么都失败==</strong></p>
<p>举例： </p>
<ol>
<li>SQL执行  A给B转账</li>
<li>SQL执行  B收到A的钱</li>
</ol>
<h3 id="1-核心-：要么都成功，要么都失败"><a href="#1-核心-：要么都成功，要么都失败" class="headerlink" title="1. 核心 ：要么都成功，要么都失败"></a>1. 核心 ：要么都成功，要么都失败</h3><ul>
<li>将一组SQL放在同一个批次去执行</li>
<li>如果一个SQL语句出错,则该批次内的所有SQL都将被取消执行</li>
<li>MySQL事务处理只支持InnoDB和BDB数据表类型</li>
</ul>
      
      <a class="article-more-link" href="/2019/02/19/Mysql/Mysql-06-%E4%BA%8B%E5%8A%A1/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Mysql/" rel="tag">Mysql</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E6%95%B0%E6%8D%AE%E5%BA%93/" rel="tag">数据库</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-Mysql/Mysql-事务" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2019/02/19/Mysql/Mysql-%E4%BA%8B%E5%8A%A1/"
    >Mysql-事务</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2019/02/19/Mysql/Mysql-%E4%BA%8B%E5%8A%A1/" class="article-date">
  <time datetime="2019-02-19T08:02:27.000Z" itemprop="datePublished">2019-02-19</time>
</a>
      
      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h1 id="Mysql-事务"><a href="#Mysql-事务" class="headerlink" title="Mysql 事务"></a>Mysql 事务</h1><h2 id="Mysql-事务-1"><a href="#Mysql-事务-1" class="headerlink" title="Mysql 事务"></a>Mysql 事务</h2><p><strong>事务：==要么都成功，要么都失败==</strong></p>
<p>举例： </p>
<ol>
<li>SQL执行  A给B转账</li>
<li>SQL执行  B收到A的钱</li>
</ol>
<h3 id="1-核心-：要么都成功，要么都失败"><a href="#1-核心-：要么都成功，要么都失败" class="headerlink" title="1. 核心 ：要么都成功，要么都失败"></a>1. 核心 ：要么都成功，要么都失败</h3><ul>
<li>将一组SQL放在同一个批次去执行</li>
<li>如果一个SQL语句出错,则该批次内的所有SQL都将被取消执行</li>
<li>MySQL事务处理只支持InnoDB和BDB数据表类型</li>
</ul>
      
      <a class="article-more-link" href="/2019/02/19/Mysql/Mysql-%E4%BA%8B%E5%8A%A1/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Mysql/" rel="tag">Mysql</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E6%95%B0%E6%8D%AE%E5%BA%93/" rel="tag">数据库</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-Mysql/Mysql-05-函数和编程" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2019/02/16/Mysql/Mysql-05-%E5%87%BD%E6%95%B0%E5%92%8C%E7%BC%96%E7%A8%8B/"
    >Mysql-05-函数和编程</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2019/02/16/Mysql/Mysql-05-%E5%87%BD%E6%95%B0%E5%92%8C%E7%BC%96%E7%A8%8B/" class="article-date">
  <time datetime="2019-02-16T08:02:27.000Z" itemprop="datePublished">2019-02-16</time>
</a>
      
      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h1 id="Mysql-05-函数和编程"><a href="#Mysql-05-函数和编程" class="headerlink" title="Mysql-05-函数和编程"></a>Mysql-05-函数和编程</h1><h2 id="官方文档"><a href="#官方文档" class="headerlink" title="官方文档"></a>官方文档</h2><p><a href="https://dev.mysql.com/doc/refman/5.7/en/func-op-summary-ref.html" target="_blank" rel="noopener">官网文档</a></p>
<h2 id="常用函数"><a href="#常用函数" class="headerlink" title="常用函数"></a>常用函数</h2><h3 id="数学函数"><a href="#数学函数" class="headerlink" title="数学函数"></a>数学函数</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"># 数学函数 (这里只列出一些常用的)</span><br><span class="line"></span><br><span class="line">SELECT ABS(-8);  &#x2F;*绝对值*&#x2F;</span><br><span class="line"></span><br><span class="line">SELECT CEILING(9.4);  &#x2F;*向上取整*&#x2F;</span><br><span class="line"></span><br><span class="line">SELECT FLOOR(9.4);  &#x2F;*向下取整*&#x2F;</span><br><span class="line"></span><br><span class="line">SELECT RAND();  &#x2F;*随机数,返回一个0-1之间的随机数*&#x2F;</span><br><span class="line"></span><br><span class="line">SELECT SIGN(0); &#x2F;*符号函数: 负数返回-1,正数返回1,0返回0*&#x2F;</span><br></pre></td></tr></table></figure>
      
      <a class="article-more-link" href="/2019/02/16/Mysql/Mysql-05-%E5%87%BD%E6%95%B0%E5%92%8C%E7%BC%96%E7%A8%8B/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Mysql/" rel="tag">Mysql</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E6%95%B0%E6%8D%AE%E5%BA%93/" rel="tag">数据库</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-Mysql/Mysql-函数和编程" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2019/02/16/Mysql/Mysql-%E5%87%BD%E6%95%B0%E5%92%8C%E7%BC%96%E7%A8%8B/"
    >Mysql-函数和编程</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2019/02/16/Mysql/Mysql-%E5%87%BD%E6%95%B0%E5%92%8C%E7%BC%96%E7%A8%8B/" class="article-date">
  <time datetime="2019-02-16T08:02:27.000Z" itemprop="datePublished">2019-02-16</time>
</a>
      
      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h1 id="Mysql-函数和编程"><a href="#Mysql-函数和编程" class="headerlink" title="Mysql 函数和编程"></a>Mysql 函数和编程</h1><h2 id="官方文档"><a href="#官方文档" class="headerlink" title="官方文档"></a>官方文档</h2><p><a href="https://dev.mysql.com/doc/refman/5.7/en/func-op-summary-ref.html" target="_blank" rel="noopener">官网文档</a></p>
<h2 id="常用函数"><a href="#常用函数" class="headerlink" title="常用函数"></a>常用函数</h2><h3 id="数学函数"><a href="#数学函数" class="headerlink" title="数学函数"></a>数学函数</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"># 数学函数 (这里只列出一些常用的)</span><br><span class="line"></span><br><span class="line">SELECT ABS(-8);  &#x2F;*绝对值*&#x2F;</span><br><span class="line"></span><br><span class="line">SELECT CEILING(9.4);  &#x2F;*向上取整*&#x2F;</span><br><span class="line"></span><br><span class="line">SELECT FLOOR(9.4);  &#x2F;*向下取整*&#x2F;</span><br><span class="line"></span><br><span class="line">SELECT RAND();  &#x2F;*随机数,返回一个0-1之间的随机数*&#x2F;</span><br><span class="line"></span><br><span class="line">SELECT SIGN(0); &#x2F;*符号函数: 负数返回-1,正数返回1,0返回0*&#x2F;</span><br></pre></td></tr></table></figure>
      
      <a class="article-more-link" href="/2019/02/16/Mysql/Mysql-%E5%87%BD%E6%95%B0%E5%92%8C%E7%BC%96%E7%A8%8B/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Mysql/" rel="tag">Mysql</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E6%95%B0%E6%8D%AE%E5%BA%93/" rel="tag">数据库</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-Mysql/Mysql-04-DQL" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2019/02/15/Mysql/Mysql-04-DQL/"
    >Mysql-04-DQL</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2019/02/15/Mysql/Mysql-04-DQL/" class="article-date">
  <time datetime="2019-02-15T08:02:27.000Z" itemprop="datePublished">2019-02-15</time>
</a>
      
      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h1 id="Mysql-04-DQL"><a href="#Mysql-04-DQL" class="headerlink" title="Mysql-04-DQL"></a>Mysql-04-DQL</h1><h2 id="DQL语言"><a href="#DQL语言" class="headerlink" title="DQL语言"></a>DQL语言</h2><p><strong>DQL( Data Query Language 数据查询语言 )</strong></p>
<ul>
<li><p>查询数据库数据 , 如<strong>SELECT</strong>语句</p>
</li>
<li><p>简单的单表查询或多表的复杂查询和嵌套查询</p>
</li>
<li><p>使用频率最高的语句</p>
</li>
<li><p>是数据库语言中最核心,最重要的语句</p>
</li>
</ul>
      
      <a class="article-more-link" href="/2019/02/15/Mysql/Mysql-04-DQL/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Mysql/" rel="tag">Mysql</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E6%95%B0%E6%8D%AE%E5%BA%93/" rel="tag">数据库</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-Mysql/Mysql-查询语言" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2019/02/15/Mysql/Mysql-%E6%9F%A5%E8%AF%A2%E8%AF%AD%E8%A8%80/"
    >Mysql-查询语言</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2019/02/15/Mysql/Mysql-%E6%9F%A5%E8%AF%A2%E8%AF%AD%E8%A8%80/" class="article-date">
  <time datetime="2019-02-15T08:02:27.000Z" itemprop="datePublished">2019-02-15</time>
</a>
      
      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h1 id="Mysql-查询语言"><a href="#Mysql-查询语言" class="headerlink" title="Mysql 查询语言"></a>Mysql 查询语言</h1><h2 id="DQL语言"><a href="#DQL语言" class="headerlink" title="DQL语言"></a>DQL语言</h2><p><strong>DQL( Data Query Language 数据查询语言 )</strong></p>
<ul>
<li><p>查询数据库数据 , 如<strong>SELECT</strong>语句</p>
</li>
<li><p>简单的单表查询或多表的复杂查询和嵌套查询</p>
</li>
<li><p>使用频率最高的语句</p>
</li>
<li><p>是数据库语言中最核心,最重要的语句</p>
</li>
</ul>
      
      <a class="article-more-link" href="/2019/02/15/Mysql/Mysql-%E6%9F%A5%E8%AF%A2%E8%AF%AD%E8%A8%80/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Mysql/" rel="tag">Mysql</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E6%95%B0%E6%8D%AE%E5%BA%93/" rel="tag">数据库</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-Mysql/Mysql-03-数据管理" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2019/02/12/Mysql/Mysql-03-%E6%95%B0%E6%8D%AE%E7%AE%A1%E7%90%86/"
    >Mysql-03-数据管理</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2019/02/12/Mysql/Mysql-03-%E6%95%B0%E6%8D%AE%E7%AE%A1%E7%90%86/" class="article-date">
  <time datetime="2019-02-12T03:48:45.000Z" itemprop="datePublished">2019-02-12</time>
</a>
      
      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h1 id="Mysql：MySQL数据管理"><a href="#Mysql：MySQL数据管理" class="headerlink" title="Mysql：MySQL数据管理"></a>Mysql：MySQL数据管理</h1><h2 id="1-外键管理（一般不用）"><a href="#1-外键管理（一般不用）" class="headerlink" title="1. 外键管理（一般不用）"></a>1. 外键管理（一般不用）</h2><h3 id="外键的概念"><a href="#外键的概念" class="headerlink" title="外键的概念"></a>外键的概念</h3><p>​    如果公共关键字在一个关系中是主关键字，那么这个公共关键字被称为另一个关系的外键。</p>
<p>​    由此可见，外键表示了两个关系之间的相关联系。以另一个关系的外键作为主关键字的表被称为主表，具有此外键的表被陈伟主表的从表。</p>
<p>​    在实际操作中，将一个表的值放入第二个表中来表示关联，所使用的值是第一个表的主键值(在必要时可包括复合主键值)。此时，第二个表中保存这些值的属性称为外键(<strong>foreign key</strong>)。</p>
      
      <a class="article-more-link" href="/2019/02/12/Mysql/Mysql-03-%E6%95%B0%E6%8D%AE%E7%AE%A1%E7%90%86/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Mysql/" rel="tag">Mysql</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E6%95%B0%E6%8D%AE%E5%BA%93/" rel="tag">数据库</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-Mysql/Mysql-数据管理" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2019/02/12/Mysql/Mysql-%E6%95%B0%E6%8D%AE%E7%AE%A1%E7%90%86/"
    >Mysql-数据管理</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2019/02/12/Mysql/Mysql-%E6%95%B0%E6%8D%AE%E7%AE%A1%E7%90%86/" class="article-date">
  <time datetime="2019-02-12T03:48:45.000Z" itemprop="datePublished">2019-02-12</time>
</a>
      
      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h1 id="Mysql：MySQL数据管理"><a href="#Mysql：MySQL数据管理" class="headerlink" title="Mysql：MySQL数据管理"></a>Mysql：MySQL数据管理</h1><h2 id="外键管理（一般不用）"><a href="#外键管理（一般不用）" class="headerlink" title="外键管理（一般不用）"></a>外键管理（一般不用）</h2><h3 id="外键的概念"><a href="#外键的概念" class="headerlink" title="外键的概念"></a>外键的概念</h3><p>​    如果公共关键字在一个关系中是主关键字，那么这个公共关键字被称为另一个关系的外键。</p>
<p>​    由此可见，外键表示了两个关系之间的相关联系。以另一个关系的外键作为主关键字的表被称为主表，具有此外键的表被陈伟主表的从表。</p>
<p>​    在实际操作中，将一个表的值放入第二个表中来表示关联，所使用的值是第一个表的主键值(在必要时可包括复合主键值)。此时，第二个表中保存这些值的属性称为外键(<strong>foreign key</strong>)。</p>
      
      <a class="article-more-link" href="/2019/02/12/Mysql/Mysql-%E6%95%B0%E6%8D%AE%E7%AE%A1%E7%90%86/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Mysql/" rel="tag">Mysql</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E6%95%B0%E6%8D%AE%E5%BA%93/" rel="tag">数据库</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-Mysql/Mysql-02-操作数据库" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2019/02/11/Mysql/Mysql-02-%E6%93%8D%E4%BD%9C%E6%95%B0%E6%8D%AE%E5%BA%93/"
    >Mysql-02-操作数据库</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2019/02/11/Mysql/Mysql-02-%E6%93%8D%E4%BD%9C%E6%95%B0%E6%8D%AE%E5%BA%93/" class="article-date">
  <time datetime="2019-02-11T08:02:27.000Z" itemprop="datePublished">2019-02-11</time>
</a>
      
      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h1 id="操作数据库"><a href="#操作数据库" class="headerlink" title="操作数据库"></a>操作数据库</h1><h2 id="1-结构化语言分类"><a href="#1-结构化语言分类" class="headerlink" title="1. 结构化语言分类"></a>1. 结构化语言分类</h2><p><img src="https://zhuuu-bucket.oss-cn-beijing.aliyuncs.com/img/20200210162433.png" alt=""></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">操作数据库 &gt; 操作表 &gt; 操作表中的字段</span><br></pre></td></tr></table></figure>



<p><strong>几个基本的数据库操作命令</strong> ：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">&#x2F;*</span><br><span class="line">update user set password&#x3D;password(&#39;123456&#39;)where user&#x3D;&#39;root&#39;; 修改密码</span><br><span class="line">flush privileges;  刷新数据库</span><br><span class="line">show databases; 显示所有数据库</span><br><span class="line">use dbname； 打开某个数据库</span><br><span class="line">show tables; 显示数据库mysql中所有的表</span><br><span class="line">describe user; 显示表mysql数据库中user表的列信息</span><br><span class="line">create database name; 创建数据库</span><br><span class="line">use databasename; 选择数据库</span><br><span class="line"></span><br><span class="line">exit; 退出Mysql</span><br><span class="line">? 命令关键词 : 寻求帮助</span><br><span class="line"># 表示注释</span><br><span class="line">*&#x2F;</span><br></pre></td></tr></table></figure>
      
      <a class="article-more-link" href="/2019/02/11/Mysql/Mysql-02-%E6%93%8D%E4%BD%9C%E6%95%B0%E6%8D%AE%E5%BA%93/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Mysql/" rel="tag">Mysql</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E6%95%B0%E6%8D%AE%E5%BA%93/" rel="tag">数据库</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-Mysql/Mysql-操作数据库" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2019/02/11/Mysql/Mysql-%E6%93%8D%E4%BD%9C%E6%95%B0%E6%8D%AE%E5%BA%93/"
    >Mysql-操作数据库</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2019/02/11/Mysql/Mysql-%E6%93%8D%E4%BD%9C%E6%95%B0%E6%8D%AE%E5%BA%93/" class="article-date">
  <time datetime="2019-02-11T08:02:27.000Z" itemprop="datePublished">2019-02-11</time>
</a>
      
      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h1 id="操作数据库"><a href="#操作数据库" class="headerlink" title="操作数据库"></a>操作数据库</h1><h2 id="结构化语言分类"><a href="#结构化语言分类" class="headerlink" title="结构化语言分类"></a>结构化语言分类</h2><p><img src="https://zhuuu-bucket.oss-cn-beijing.aliyuncs.com/img/20200210162433.png" alt=""></p>
<p>操作数据库&gt;操作表&gt;操作表中的字段</p>
<p><strong>几个基本的数据库操作命令</strong> ：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">&#x2F;*</span><br><span class="line">update user set password&#x3D;password(&#39;123456&#39;)where user&#x3D;&#39;root&#39;; 修改密码</span><br><span class="line">flush privileges;  刷新数据库</span><br><span class="line">show databases; 显示所有数据库</span><br><span class="line">use dbname； 打开某个数据库</span><br><span class="line">show tables; 显示数据库mysql中所有的表</span><br><span class="line">describe user; 显示表mysql数据库中user表的列信息</span><br><span class="line">create database name; 创建数据库</span><br><span class="line">use databasename; 选择数据库</span><br><span class="line"></span><br><span class="line">exit; 退出Mysql</span><br><span class="line">? 命令关键词 : 寻求帮助</span><br><span class="line"># 表示注释</span><br><span class="line">*&#x2F;</span><br></pre></td></tr></table></figure>
      
      <a class="article-more-link" href="/2019/02/11/Mysql/Mysql-%E6%93%8D%E4%BD%9C%E6%95%B0%E6%8D%AE%E5%BA%93/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Mysql/" rel="tag">Mysql</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E6%95%B0%E6%8D%AE%E5%BA%93/" rel="tag">数据库</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
  </article>
  

  
  <nav class="page-nav">
    
    <a class="extend prev" rel="prev" href="/page/50/">上一页</a><a class="page-number" href="/">1</a><span class="space">&hellip;</span><a class="page-number" href="/page/49/">49</a><a class="page-number" href="/page/50/">50</a><span class="page-number current">51</span><a class="page-number" href="/page/52/">52</a><a class="extend next" rel="next" href="/page/52/">下一页</a>
  </nav>
  
</section>
</div>

      <footer class="footer">
  <div class="outer">
    <ul class="list-inline">
      <li>
        &copy;
        2019-2021
        Zhuuu
      </li>
      <li>
        
      </li>
    </ul>
    <ul class="list-inline">
      <li>
        
        
        <span>
  <i>PV:<span id="busuanzi_value_page_pv"></span></i>
  <i>UV:<span id="busuanzi_value_site_uv"></span></i>
</span>
        
      </li>
      <li>
        <!-- cnzz统计 -->
        
        <script type="text/javascript" src='https://s9.cnzz.com/z_stat.php?id=1278069914&amp;web_id=1278069914'></script>
        
      </li>
    </ul>
  </div>
</footer>
    <div class="to_top">
        <div class="totop" id="totop">
  <i class="ri-arrow-up-line"></i>
</div>
      </div>
    </main>
      <aside class="sidebar">
        <button class="navbar-toggle"></button>
<nav class="navbar">
  
  <div class="logo">
    <a href="/"><img src="/images/ayer-side.svg" alt="朱酱酱的学习博客"></a>
  </div>
  
  <ul class="nav nav-main">
    
    <li class="nav-item">
      <a class="nav-item-link" href="/">主页</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags">标签</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/JVM/">JVM</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/JDK%E6%BA%90%E7%A0%81%E5%88%86%E6%9E%90/">JDK源码</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/%E5%A4%9A%E7%BA%BF%E7%A8%8B/">多线程</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/Mysql/">Mysql</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/Redis/">Redis</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/%E8%AE%BE%E8%AE%A1%E8%80%85%E6%A8%A1%E5%BC%8F/">设计模式</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/MyBatis/">MyBatis</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/SpringMVC/">SpringMVC</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/Spring/">Spring</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/SpringBoot/">SpringBoot</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/">Linux</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/Leetcode/">Leetcode</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/%E5%89%8D%E7%AB%AF/">前端</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/%E7%BD%91%E7%BB%9C%E7%BC%96%E7%A8%8B/">网络编程</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/photoshop/">photoshop</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="http://smartzhuuu.lofter.com/" target="_blank" rel="noopener">摄影</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/2020/about">关于我</a>
    </li>
    
  </ul>
</nav>
<nav class="navbar navbar-bottom">
  <ul class="nav">
    <li class="nav-item">
      
      <a class="nav-item-link nav-item-search"  title="Search">
        <i class="ri-search-line"></i>
      </a>
      
      
      <a class="nav-item-link" target="_blank" href="/atom.xml" title="RSS Feed">
        <i class="ri-rss-line"></i>
      </a>
      
    </li>
  </ul>
</nav>
<div class="search-form-wrap">
  <div class="local-search local-search-plugin">
  <input type="search" id="local-search-input" class="local-search-input" placeholder="Search...">
  <div id="local-search-result" class="local-search-result"></div>
</div>
</div>
      </aside>
      <div id="mask"></div>

<!-- #reward -->
<div id="reward">
  <span class="close"><i class="ri-close-line"></i></span>
  <p class="reward-p"><i class="ri-cup-line"></i>请我喝杯咖啡吧~</p>
  <div class="reward-box">
    
    <div class="reward-item">
      <img class="reward-img" src="/images/alipay.jpg">
      <span class="reward-type">支付宝</span>
    </div>
    
    
    <div class="reward-item">
      <img class="reward-img" src="/images/wechat.jpg">
      <span class="reward-type">微信</span>
    </div>
    
  </div>
</div>
      
<script src="/js/jquery-2.0.3.min.js"></script>


<script src="/js/jquery.justifiedGallery.min.js"></script>


<script src="/js/lazyload.min.js"></script>


<script src="/js/busuanzi-2.3.pure.min.js"></script>


<script src="/js/share.js"></script>



<script src="/fancybox/jquery.fancybox.min.js"></script>




<script>
  try {
    var typed = new Typed("#subtitle", {
    strings: ['昨夜西风凋碧树。独上高楼，望尽天涯路','衣带渐宽终不悔，为伊消得人憔悴。','众里寻他千百度。蓦然回首，那人却在，灯火阑珊处。'],
    startDelay: 0,
    typeSpeed: 200,
    loop: true,
    backSpeed: 100,
    showCursor: true
    });
  } catch (err) {
  }
  
</script>




<script>
  var ayerConfig = {
    mathjax: true
  }
</script>


<script src="/js/ayer.js"></script>


<script src="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.css">


<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">

    <!-- Background of PhotoSwipe. 
         It's a separate element as animating opacity is faster than rgba(). -->
    <div class="pswp__bg"></div>

    <!-- Slides wrapper with overflow:hidden. -->
    <div class="pswp__scroll-wrap">

        <!-- Container that holds slides. 
            PhotoSwipe keeps only 3 of them in the DOM to save memory.
            Don't modify these 3 pswp__item elements, data is added later on. -->
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>

        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
        <div class="pswp__ui pswp__ui--hidden">

            <div class="pswp__top-bar">

                <!--  Controls are self-explanatory. Order can be changed. -->

                <div class="pswp__counter"></div>

                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>

                <button class="pswp__button pswp__button--share" style="display:none" title="Share"></button>

                <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>

                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>

                <!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
                <!-- element will get class pswp__preloader--active when preloader is running -->
                <div class="pswp__preloader">
                    <div class="pswp__preloader__icn">
                        <div class="pswp__preloader__cut">
                            <div class="pswp__preloader__donut"></div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
                <div class="pswp__share-tooltip"></div>
            </div>

            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
            </button>

            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
            </button>

            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>

        </div>

    </div>

</div>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/default-skin/default-skin.css">
<script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe-ui-default.min.js"></script>

<script>
    function viewer_init() {
        let pswpElement = document.querySelectorAll('.pswp')[0];
        let $imgArr = document.querySelectorAll(('.article-entry img:not(.reward-img)'))

        $imgArr.forEach(($em, i) => {
            $em.onclick = () => {
                // slider展开状态
                // todo: 这样不好，后面改成状态
                if (document.querySelector('.left-col.show')) return
                let items = []
                $imgArr.forEach(($em2, i2) => {
                    let img = $em2.getAttribute('data-idx', i2)
                    let src = $em2.getAttribute('data-target') || $em2.getAttribute('src')
                    let title = $em2.getAttribute('alt')
                    // 获得原图尺寸
                    const image = new Image()
                    image.src = src
                    items.push({
                        src: src,
                        w: image.width || $em2.width,
                        h: image.height || $em2.height,
                        title: title
                    })
                })
                var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, {
                    index: parseInt(i)
                });
                gallery.init()
            }
        })
    }
    viewer_init()
</script>



<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
      tex2jax: {
          inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
          processEscapes: true,
          skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
      }
  });

  MathJax.Hub.Queue(function() {
      var all = MathJax.Hub.getAllJax(), i;
      for(i=0; i < all.length; i += 1) {
          all[i].SourceElement().parentNode.className += ' has-jax';
      }
  });
</script>

<script src="https://cdn.jsdelivr.net/npm/mathjax@2.7.6/unpacked/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>


<script type="text/javascript" src="https://js.users.51.la/20544303.js"></script>
  </div>
</body>

</html>